var express = require('express');
var router = express.Router();
const middleWare = require('../middleWare/middleWare');
const userLogic = require('../userLogic/userLogic');

/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});

// 登录
router.get('/login', middleWare.verifyLogin, function (req, res, next) {
  userLogic.loginLogic(req, res);
})

// 注册
router.post('/register',middleWare.verifyRegister, function (req, res, next) {
  userLogic.registerLogic(req, res);
})

module.exports = router;
